/*
 * ParserHelper.h
 *
 *  Created on: Aug 26, 2011
 *      Author: mengwei.chua
 */

#ifndef PARSERHELPER_H_
#define PARSERHELPER_H_

#define TIXML_QUERY_STRING(element, name, data) (NULL != element->Attribute(name)) ? data = element->Attribute(name) : data = ""
#define TIXML_QUERY_UNSIGNED_INT(element, name, data) if(TIXML_SUCCESS != element->QueryUnsignedAttribute(name, &data)) data = 0u
#define TIXML_QUERY_FLOAT(element, name, data) if(TIXML_SUCCESS != element->QueryFloatAttribute(name, &data)) data = 0.0f
#define TIXML_QUERY_BOOL(element, name, data) if(TIXML_SUCCESS != element->QueryBoolAttribute(name, &data)) data = false

#endif /* PARSERHELPER_H_ */
